package jcommon.beans4ex;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ReflectionToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

public class BaseBean {
	@Override
	public String toString() {
		return ReflectionToStringBuilder.toString(this, new ToStringStyle() {
			private static final long serialVersionUID = 5285428321404134054L;
			{
				// setUseClassName(false);
				setUseShortClassName(true);
				setUseIdentityHashCode(false);
				// this.setUseFieldNames(false);
			}
		});
	}

	@Override
	public int hashCode() {
		return HashCodeBuilder.reflectionHashCode(this);
	}

	@Override
	public boolean equals(Object obj) {
		return EqualsBuilder.reflectionEquals(this, obj);
	}
}
